<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <title>用户中心-首页</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://v3.bootcss.com/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
    <link href="/static/pc/cmgd.css" rel="stylesheet">
    <link href="/static/pc/style.css" rel="stylesheet">
    <link rel="stylesheet" href="/static/pc/swiper.3.2.0.min.css">
    <link rel="stylesheet" type="text/css" href="/static/admin/webupload/webuploader.css">
    <link rel="stylesheet" type="text/css" href="/static/admin/webupload/style.css">
    <!--[if lt IE 9]><script src="http://v3.bootcss.com/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="http://v3.bootcss.com/assets/js/ie-emulation-modes-warning.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/admin/js/jquery.form.js"></script>
    <script src="/static/admin/js/plugins/layer/laydate/laydate.js"></script>
    <script src="/static/pc/js/layer/layer.js"></script>
    <script src="/static/admin/js/laypage/laypage.js"></script>
    <script src="/static/admin/js/laytpl/laytpl.js"></script>
    <link href="/static/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <style>
        .list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover{
            background: #fff;
            color: #2fab87;
            border-bottom: 0px;
        }
        .list-group-item:first-child {border-radius: 0px;   }
        .fa{padding-right: 15px;font-size:18px;}
        .list-group-item{font-size:16px; border-top:0px;border-bottom: 1px #f5f5f5 solid;padding-top:20px;padding-bottom:20px; padding-left: 40px;
            border-left:0px;            border-right:0px;}
        .panel-heading{background: #f5f5f5;}
        .panel-primary>.panel-heading {
            color: #fff;
            background-color: #2fab87;
            border-color: #2fab87;
        }
        .panel-primary {
            border-color: #fff;
        }
        body{background:#f5f5f5;}
        .col-xs-12, .col-sm-9{padding-left: 0px;}
        .index_img li{
            float: left;
            width: 33%;
            text-align: center;
            list-style: none;
        }
        .num{
            font-size:30px;
            color:#00a0e9;
        }
        #article_list{padding-left: 20px;}
    </style>
</head>

<body >
{include file="public/header4" /}

<div class="container body_bg" style="margin-top:80px;">

    <div class="row row-offcanvas row-offcanvas-right">
        <div class="col-xs-3 col-sm-3 sidebar-offcanvas" id="sidebar">

            {include file="public/user_center" /}

        </div><!--/.sidebar-offcanvas-->
        <div class="col-xs-12 col-sm-9">

            <div class="panel panel-primary" style="min-height: 770px;">
                <!--<div class="panel-heading">-->
                    <!--首页-->
                <!--</div>-->
                <div class="panel-body">
                    <div class="wrapper wrapper-content animated fadeInRight">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="ibox float-e-margins">
                                    <div class="ibox-content" style="height:450px;padding-top: 40px;">

                                            <div class="index_img" style="border-bottom: 1px #f5f5f5 solid;height: 100px;">
                                                <!--http://www.shuren100.com/web/user/fans/user_id/212082.html-->
                                                <A href="{:url('user/center',array('user_id'=>$user_id))}"><li><p class="num">{$info.article_count}</p><p>已发布文章</p></li></A>
                                                <A href="{:url('user/focus',array('user_id'=>$user_id))}"><li><p class="num">{$info.focus_count}</p><p>关注</p></li></A>
                                                    <A href="{:url('user/fans',array('user_id'=>$user_id))}"><li><p class="num">{$info.fans_count}</p><p>粉丝</p></li></A>
                                            </div>


                                            <div style="padding:20px 0 0 40px;font-size:18px;color: #FFD200;">系统公告</div>

                                                <script id="arlist" type="text/html">
                                                    {{# for(var i=0;i<d.length;i++){  }}
                                                        <div style="font-size:16px; height:36px;line-height:36px;">
                                                          <a href="/web/article/index_notice/id/{{d[i].id}}.html"  >
                                                            <div style="width: 80%;float: left;padding-left: 20px; font-size:15px;overflow: hidden;color:#000;"> {{d[i].title}}</div>
                                                          </a>
                                                            <div style="width: 20%;float: left;text-align: left; font-size:15px;padding-right: 5px;">{{d[i].addtime}}</div>
                                                        </div>
                                                    {{# } }}
                                                </script>
                                                <div id="article_list"></div>
                                                <div id="AjaxPage" style=" text-align:center;margin-top:20px;"></div>
                                                <div id="allpage" style=" text-align: center;"></div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div><!--/row-->
    <hr>
    <footer style="text-align: center;">
        <p>&copy; Company 2017</p>
    </footer>

</div>
<script type="text/javascript">
    function Ajaxpage(curr){

        $.getJSON('{:url("Article/user_index")}', {
            page: curr || 1
        }, function(data){      //data是后台返回过来的JSON数据

            $(".spiner-example").css('display','none'); //数据加载完关闭动画
            if(data==''){
                $("#article_list").html('<td colspan="20" style="padding-top:10px;padding-bottom:10px;font-size:16px;text-align:center">暂无数据</td>');
            }else{


                console.log(data);

                article_list(data.list); //模板赋值
                laypage({
                    cont: $('#AjaxPage'),//容器。值支持id名、原生dom对象，jquery对象,
                    pages:'{$allpage}',//总页数
                    skip: true,//是否开启跳页
                    skin: '#1AB5B7',//分页组件颜色
                    curr: curr || 1,
                    groups: 3,//连续显示分页数
                    jump: function(obj, first){

                        if(!first){
                            Ajaxpage(obj.curr)
                        }
                        $('#allpage').html('第'+ obj.curr +'页，共'+ obj.pages +'页');
                    }
                });
            }
        });
    }

    Ajaxpage();
    function article_list(list){

        var tpl = document.getElementById('arlist').innerHTML;
        laytpl(tpl).render(list, function(html){
            document.getElementById('article_list').innerHTML = html;
        });
    }

    function nofind(){
        console.log('1');
        $('#img11').src="http://www.cnblogs.com/sys/common/image/fileoperation/icon/default.gif";
        $('#img11').onerror=null;

    }




</script>
</body>
</html>
